package com.erp.erp_servers.ProductPriceRange.impl;

import com.erp.erp_dao.ProductPriceRange.ProductPriceRangeDao;
import com.erp.erp_entitys.ProductBoxGauge.ProductBoxGauge;
import com.erp.erp_entitys.ProductPriceRange.ProductPriceRange;
import com.erp.erp_servers.ProductPriceRange.IProductPriceRangeService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjk
 * @version 1.0
 * @description
 * @date 2021-09-16 23:03
 */
@Service
public class ProductPriceRangeImpl implements IProductPriceRangeService {
    private final ProductPriceRangeDao priceRangeDao;

    public ProductPriceRangeImpl(ProductPriceRangeDao priceRangeDao) {
        this.priceRangeDao = priceRangeDao;
    }


    @Override
    public Integer insertSelective(ProductPriceRange record) {
        return priceRangeDao.insertSelective(record);
    }

    @Override
    public PageInfo<ProductPriceRange> findPriceRangeByParam(String productCode, String specificationCode) {
        List<ProductPriceRange> list = priceRangeDao.findPriceRangeByParam(productCode,specificationCode);
        PageInfo pageInfo=new PageInfo(list);
        return pageInfo;
    }

    @Override
    public Integer updateByParam(ProductPriceRange record) {
        return priceRangeDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public Integer deleteByIds(List<Integer> ids) {
        return priceRangeDao.deleteByIds(ids);
    }

    @Override
    public int deleteByParam(ProductPriceRange record) {
        return priceRangeDao.deleteByParam(record);
    }
}
